package cn.iocoder.yudao.module.wms.service.rdrecord09.listener;

import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEvent;
import cn.iocoder.yudao.module.bpm.event.BpmProcessInstanceStatusEventListener;
import cn.iocoder.yudao.module.wms.service.rdrecord09.Rdrecord09Service;
import cn.iocoder.yudao.module.wms.service.rdrecord09.Rdrecord09ServiceImpl;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 其他出库监听器
 *
 * @author 芋道源码
 */
@Component
public class Rdrecord09StatusListener extends BpmProcessInstanceStatusEventListener {
    @Resource
    private Rdrecord09Service rdrecord09Service;

    @Override
    protected String getProcessDefinitionKey() {
        return Rdrecord09ServiceImpl.PROCESS_KEY;
    }

    @Override
    protected void onEvent(BpmProcessInstanceStatusEvent event) {
        rdrecord09Service.updateRdrecord09Status(Long.valueOf(event.getBusinessKey()),event.getStatus());
        /*if (event.getStatus().equals(BpmTaskStatusEnum.APPROVE.getStatus())) {
            //todo 对子表进行业务处理
            rdrecord09Service.businessProcessing(Long.valueOf(event.getBusinessKey()));
        }*/
    }
}
